<include file="public@header"/>
</head>
<style>
    .form-search label{width:300px;}
    .form-search label.date{width:300px;}
    .form-search input.js-date{width:80px;}
    .form-search select{width:auto !important;}
    .groups{overflow:hidden; width:46%; border-right:1px double #0b7ebf; float:left; margin-bottom:50px; padding:4%;}
    .groups1{overflow:hidden; width:45%; float:left}
    .control-group{/*width:95%; margin:5px 5% 5px 0; overflow:hidden; border-bottom:1px dashed #eee */}
    .control-group1{width:90%; margin:10px 5%; overflow:hidden; border-bottom:1px dashed #eee}
    .control-group label{ width:50%; float:left}
    .control-group1 label{ width:100%; float:left}
    .form-horizontal .control-group1 {
        float: left;
        width: 25%;
        margin-bottom: 20px;
    }
    .form-horizontal .control-label {width:100px;}
    .form-horizontal .controls {margin-left:110px;}
    
</style>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('visua')}">{:lang('可视化墓区')}</a></li>
        <li><a href="{:url('sale')}?order_id={$order_id}">墓位信息</a></li>
        <li><a href="{:url('applyer')}?order_id={$order_id}">购墓人信息</a></li>
        <li class="active"><a href="{:url('deposit')}?order_id={$order_id}">定金</a></li>
    </ul>
    <form class="form-horizontal js-ajax-form" action="{:url('')}" method="post">
        <input type="hidden" name="order_id" value="{$order_id}">
        <input type="hidden" name="mw_id" value="{$order_info.tomb_id}">
        <input type="hidden" name="orders_id" value="{$order_info.orders_id}">
        <input type="hidden" name="mw_num" value="{$order_info.tomb_num}">
        <input type="hidden" name="customer_id" value="{$order_info.customer_id}">
        <fieldset>
            <div class="form-group">
                <label class=" control-label">付款人姓名</label>
                <div class="col-lg-2">
                    <input type="text" name="real_name" class="form-control" value="{$order_info.buyer_name}" required>
                </div>
                <label class=" control-label">付款人手机号</label>
                <div class="col-lg-2">
                    <input type="text" name="real_phone" class="form-control" value="{$order_info.buyer_phone}" required>
                </div>
            </div>
            <div class="form-group">
                <label class=" control-label">成交金额</label>
                <div class="col-lg-2">
                    <input type="hidden"  name="closing_price" class="form-control" value="{$order_info.closing_price}" >
                    <input type="text"   class="form-control" value="{$order_info.closing_price}" disabled>元
                </div>
            </div>
            <div class="form-group">
                <label class=" control-label">定金金额</label>
                <div class="col-lg-2">
                    <input type="text" name="deposit_price" class="form-control" value="{$deposit_price}" required>元
                </div>
                <label class=" control-label">定金方式</label>
                <div class="col-lg-2">
                    <select name="deposit_type" class="form-control">
                        <option value="1">现金</option>
                        <option value="2">转账</option>
                        <option value="3">电汇</option>
                        <option value="4">微信</option>
                        <option value="5">支付宝</option>
                        <option value="6">其他</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class=" control-label">失效日期</label>
                <div class="col-lg-2">
                    <input type="text" name="end_time" class="form-control js-date" value="{$end_time}" required autocomplete="off">
                </div>
                <label class=" control-label"> </label>
                <div class="col-lg-2">

                </div>
            </div>
        </fieldset>
        <div class="form-actions">
            <button type="submit"   class="btn btn-primary js-ajax-submit">提交</button>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>

<script type="text/javascript">

    $("#next").click(function () {
        var flag = $('#flag input:radio:checked').val();
        var deceased_name = $('input[name="deceased_name[]"]').val();
        var order_id = $('input[name="order_id"]').val();
        console.log(flag==0)
        console.log(!deceased_name)
        console.log(flag == 0  && !deceased_name )
        if (flag == 0  && !deceased_name ) {
            alert("请填写使用人！")
        }else if(flag == 1) {
            $(this).prop({href: "{:url('chooseGoods')}?order_id="+order_id});
        }
    });



    // 提交订单
    $("#check-btn").click(function () {
        $.post($("form").attr('action'), $("form").serialize(), function (result) {
            if (result.state == 'success') {
                alert("保存成功！");
                $('#js-dialog-close').click();
            } else {
                alert(result.info);
            }
        }, 'json');
    });

</script>

</body>
</html>